Skip to contentSkip to conversation

Change in openvpn[master]: dco: remove dco_read/write_bytes from dco_context_t

Openvpn-devel In review ralf_lici (Code Review) 2 participants 6 messages Oct 15, 2025 – Oct 19, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1760513121000.I61f9d9bb26112eac0c0a47cb9d17982b075887ff@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email

to review the following change.

Change subject: dco: remove dco_read/write_bytes from dco_context_t
......................................................................

dco: remove dco_read/write_bytes from dco_context_t

Remove dco_read_bytes and dco_write_bytes from all dco_context_t structures, as peer statistics are now stored directly in the corresponding c2 fields across all DCO interfaces.

Change-Id I61f9d9bb26112eac0c0a47cb9d17982b075887ff

---
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.h
M src/openvpn/multi.c

4 files changed, 0 insertions(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/76/1276/1

src/openvpn/dco_freebsd.h +0 -2
index 2f486f0..0797b82 100644
@@ -59,8 +59,6 @@
     int dco_message_peer_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 
     struct context *c;
 } dco_context_t;
src/openvpn/dco_linux.h +0 -2
index 310d433..efd5b27 100644
@@ -81,8 +81,6 @@
     int dco_message_key_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 } dco_context_t;
 
 #endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
src/openvpn/dco_win.h +0 -3
index 4f3f028..02b8389 100644
@@ -55,9 +55,6 @@
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
 
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
-
     struct context *c;
 };
 
src/openvpn/multi.c +0 -4
index 2863ff1..053c54d 100644
@@ -3266,8 +3266,6 @@
      * installed, and we do not need to clean up the state in the kernel */
     mi->context.c2.tls_multi->dco_peer_id = -1;
     mi->context.sig->signal_text = reason;
-    mi->context.c2.dco_read_bytes = dco->dco_read_bytes;
-    mi->context.c2.dco_write_bytes = dco->dco_write_bytes;
     multi_signal_instance(m, mi, SIGTERM);
 }
 
@@ -3337,8 +3335,6 @@
     dco->dco_message_type = 0;
     dco->dco_message_peer_id = -1;
     dco->dco_del_peer_reason = -1;
-    dco->dco_read_bytes = 0;
-    dco->dco_write_bytes = 0;
     return ret > 0;
 }
 #endif /* if defined(ENABLE_DCO) */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I61f9d9bb26112eac0c0a47cb9d17982b075887ff
Gerrit-Change-Number: 1276
Gerrit-PatchSet: 1
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos, ralf_lici.

cron2 has posted comments on this change by ralf_lici. ( http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email )

Change subject: dco: remove dco_read/write_bytes from dco_context_t
......................................................................

Patch Set 2: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I61f9d9bb26112eac0c0a47cb9d17982b075887ff
Gerrit-Change-Number: 1276
Gerrit-PatchSet: 2
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ralf_lici <[email protected]...>
Gerrit-Comment-Date: Fri, 17 Oct 2025 20:58:23 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH v2 1/1 dco: remove dco_read/write_bytes from dco_context_t

In reply to a message not in the archive

From: Ralf Lici <[email protected]...>

Remove dco_read_bytes and dco_write_bytes from all dco_context_t structures, as peer statistics are now stored directly in the corresponding c2 fields across all DCO interfaces.

Change-Id I61f9d9bb26112eac0c0a47cb9d17982b075887ff

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1276
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1276
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/dco_freebsd.h +0 -2
index 2f486f0..0797b82 100644
@@ -59,8 +59,6 @@
     int dco_message_peer_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 
     struct context *c;
 } dco_context_t;
src/openvpn/dco_linux.h +0 -2
index 310d433..efd5b27 100644
@@ -81,8 +81,6 @@
     int dco_message_key_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 } dco_context_t;
 
 #endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
src/openvpn/dco_win.h +0 -3
index 4f3f028..02b8389 100644
@@ -55,9 +55,6 @@
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
 
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
-
     struct context *c;
 };
 
src/openvpn/multi.c +0 -4
index 2863ff1..053c54d 100644
@@ -3266,8 +3266,6 @@
      * installed, and we do not need to clean up the state in the kernel */
     mi->context.c2.tls_multi->dco_peer_id = -1;
     mi->context.sig->signal_text = reason;
-    mi->context.c2.dco_read_bytes = dco->dco_read_bytes;
-    mi->context.c2.dco_write_bytes = dco->dco_write_bytes;
     multi_signal_instance(m, mi, SIGTERM);
 }
 
@@ -3337,8 +3335,6 @@
     dco->dco_message_type = 0;
     dco->dco_message_peer_id = -1;
     dco->dco_del_peer_reason = -1;
-    dco->dco_read_bytes = 0;
-    dco->dco_write_bytes = 0;
     return ret > 0;
 }
 #endif /* if defined(ENABLE_DCO) */
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: dco: remove dco_read/write_bytes from dco_context_t

As this is fairly straightforward ("remove things nobody wants anymore"), I have only compile-tested on FreeBSD/DCO, Linux/DCO and MinGW. Compiles fine :-)

Your patch has been applied to the master branch.

commit 3e76d8f8a475d08bcb50321e742a06c53e19d45d

Author: Ralf Lici
Date:   Fri Oct 17 22:58:31 2025 +0200
     dco: remove dco_read/write_bytes from dco_context_t

     Signed-off-by: Ralf Lici <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1276
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg33431.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#3) to the change originally created by ralf_lici. ( http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: dco: remove dco_read/write_bytes from dco_context_t
......................................................................

dco: remove dco_read/write_bytes from dco_context_t

Remove dco_read_bytes and dco_write_bytes from all dco_context_t structures, as peer statistics are now stored directly in the corresponding c2 fields across all DCO interfaces.

Change-Id I61f9d9bb26112eac0c0a47cb9d17982b075887ff

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1276
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33431.html

---
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.h
M src/openvpn/multi.c

4 files changed, 0 insertions(+), 11 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/76/1276/3

src/openvpn/dco_freebsd.h +0 -2
index 2f486f0..0797b82 100644
@@ -59,8 +59,6 @@
     int dco_message_peer_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 
     struct context *c;
 } dco_context_t;
src/openvpn/dco_linux.h +0 -2
index 310d433..efd5b27 100644
@@ -81,8 +81,6 @@
     int dco_message_key_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 } dco_context_t;
 
 #endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
src/openvpn/dco_win.h +0 -3
index 4f3f028..02b8389 100644
@@ -55,9 +55,6 @@
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
 
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
-
     struct context *c;
 };
 
src/openvpn/multi.c +0 -4
index 558314c..e907524 100644
@@ -3266,8 +3266,6 @@
      * installed, and we do not need to clean up the state in the kernel */
     mi->context.c2.tls_multi->dco_peer_id = -1;
     mi->context.sig->signal_text = reason;
-    mi->context.c2.dco_read_bytes = dco->dco_read_bytes;
-    mi->context.c2.dco_write_bytes = dco->dco_write_bytes;
     multi_signal_instance(m, mi, SIGTERM);
 }
 
@@ -3337,8 +3335,6 @@
     dco->dco_message_type = 0;
     dco->dco_message_peer_id = -1;
     dco->dco_del_peer_reason = -1;
-    dco->dco_read_bytes = 0;
-    dco->dco_write_bytes = 0;
     return ret > 0;
 }
 #endif /* if defined(ENABLE_DCO) */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I61f9d9bb26112eac0c0a47cb9d17982b075887ff
Gerrit-Change-Number: 1276
Gerrit-PatchSet: 3
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email )

Change subject: dco: remove dco_read/write_bytes from dco_context_t
......................................................................

dco: remove dco_read/write_bytes from dco_context_t

Remove dco_read_bytes and dco_write_bytes from all dco_context_t structures, as peer statistics are now stored directly in the corresponding c2 fields across all DCO interfaces.

Change-Id I61f9d9bb26112eac0c0a47cb9d17982b075887ff

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1276
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg33431.html

---
M src/openvpn/dco_freebsd.h
M src/openvpn/dco_linux.h
M src/openvpn/dco_win.h
M src/openvpn/multi.c

4 files changed, 0 insertions(+), 11 deletions(-)
src/openvpn/dco_freebsd.h +0 -2
index 2f486f0..0797b82 100644
@@ -59,8 +59,6 @@
     int dco_message_peer_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 
     struct context *c;
 } dco_context_t;
src/openvpn/dco_linux.h +0 -2
index 310d433..efd5b27 100644
@@ -81,8 +81,6 @@
     int dco_message_key_id;
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
 } dco_context_t;
 
 #endif /* defined(ENABLE_DCO) && defined(TARGET_LINUX) */
src/openvpn/dco_win.h +0 -3
index 4f3f028..02b8389 100644
@@ -55,9 +55,6 @@
     int dco_del_peer_reason;
     struct sockaddr_storage dco_float_peer_ss;
 
-    uint64_t dco_read_bytes;
-    uint64_t dco_write_bytes;
-
     struct context *c;
 };
 
src/openvpn/multi.c +0 -4
index 558314c..e907524 100644
@@ -3266,8 +3266,6 @@
      * installed, and we do not need to clean up the state in the kernel */
     mi->context.c2.tls_multi->dco_peer_id = -1;
     mi->context.sig->signal_text = reason;
-    mi->context.c2.dco_read_bytes = dco->dco_read_bytes;
-    mi->context.c2.dco_write_bytes = dco->dco_write_bytes;
     multi_signal_instance(m, mi, SIGTERM);
 }
 
@@ -3337,8 +3335,6 @@
     dco->dco_message_type = 0;
     dco->dco_message_peer_id = -1;
     dco->dco_del_peer_reason = -1;
-    dco->dco_read_bytes = 0;
-    dco->dco_write_bytes = 0;
     return ret > 0;
 }
 #endif /* if defined(ENABLE_DCO) */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1276?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I61f9d9bb26112eac0c0a47cb9d17982b075887ff
Gerrit-Change-Number: 1276
Gerrit-PatchSet: 3
Gerrit-Owner: ralf_lici <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>